package com.sun.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 注解配置方式
 */
@Data
@Configuration
public class AppConfig {

    @Value("${test.param1:local-default-1}")
    private String testParam1;

    @Value("${test.param2:local-default-2}")
    private String testParam2;

    @Value("${test.param3:local-default-3}")
    private String testParam3;

    @Value("${test.param4:local-default-4}")
    private String testParam4;

    @Value("${test.param5:local-default-5}")
    private String testParam5;

    @Value("${test.param6:local-default-6}")
    private String testParam6;

    @Bean
    public void init() {
        System.out.println("AppConfig testParam1 = " + testParam1);
        System.out.println("AppConfig testParam2 = " + testParam2);
        System.out.println("AppConfig testParam3 = " + testParam3);
        System.out.println("AppConfig testParam4 = " + testParam4);
        System.out.println("AppConfig testParam5 = " + testParam5);
        System.out.println("AppConfig testParam6 = " + testParam6);
    }

}
